﻿using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace WXDba
{
    /// <summary>  
    /// 基础访问接口，使用泛型  
    /// </summary>  
    public interface IBaseAbstract<T> where T : class
    {
        #region 基础访问  
        /// <summary>  
        /// 获取表达式树  
        /// </summary>  
        /// <returns></returns>  
        DbSet<T> GetDbSet();
        /// <summary>  
        /// 获取对象  
        /// </summary>  
        /// <param name="ID">主键ID</param>  
        /// <returns></returns>  
        T GetModel(int ID);
        /// <summary>  
        /// 添加对象  
        /// </summary>  
        /// <param name="model">对象</param>  
        /// <returns></returns>  
        bool Add(T model);
        /// <summary>  
        /// 修改对象  
        /// </summary>  
        /// <param name="model">对象</param>  
        /// <returns></returns>  
        bool Modify(T model);
        /// <summary>  
        /// 删除对象  
        /// </summary>  
        /// <param name="model">对象</param>  
        /// <returns></returns>  
        bool Delete(T model);
        /// <summary>  
        /// 删除对象  
        /// </summary>  
        /// <param name="ID">主键ID</param>  
        /// <returns></returns>  
        bool Delete(int ID);
        #endregion
    }
}
